<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/jquery-1.4.2.js"></script>
</head>
<body>
    <form action="/register" method="post">
        {{ form.csrf_token }}  <!-- 必须添加这一行，否则表单无法提交 -->
        <div>
            {{ form.user_name.label }}  : {{form.user_name}}
            <!--错误信息提示-->
            {% for error in form.user_name.errors%}
                <span style="color:red"> {{ error }}</span>
            {% endfor%}
        </div>

        <div>
             {{ form.password.label }} : {{ form.password }}
             <!--错误信息提示-->
            {% for error in form.password.errors%}
                <span style="color:red"> {{ error }}</span>
            {% endfor%}
        </div>
       <div>
            {{ form.password2.label }} : {{ form.password2 }}
            <!--错误信息提示-->
            {% for error in form.password2.errors%}
                <span style="color:red"> {{ error }}</span>
            {% endfor%}
       </div>

        <br>
        <div>
             {{ form.age.label }} : {{ form.age }}
             <!--错误信息提示-->
            {% for error in form.age.errors%}
                <span style="color:red"> {{ error }}</span>
            {% endfor%}
        </div>
        <div>
            {{ form.gender.label }} :
            {% for sex in form.gender %}
                {{ sex }}
                {{ sex.label }}
            {% endfor %}
        </div>
         <div>
             {{ form.address.label}} : {{form.address}}
              <!--错误信息提示-->
            {% for error in form.address.errors%}
                <span style="color:red"> {{ error }}</span>
            {% endfor%}
         </div>
       <div>
            {{form.submit}}
       </div>
    </form>
</body>
</html>